﻿using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Xps.Packaging;
using RG.Common.WPF.Commands;
using RG.Common.WPF.Frames;
using Microsoft.Practices.Unity;
using RG.Common.WPF;

namespace RG.Common.WPF.Reporting
{
    [SupportDataBinding]
    public class SendMailReportFrame : IReportFrameVM 
    {
        [Dependency]
        public WorkplaceWorker Worker { get; set; }

        public FixedDocumentSequence ReportDoc { get; set; }

        public bool IsMailButton { get { return true; } }
        public ICommand SendMailCmd { get; set; }

        public SendMailReportFrame()
        {
            SendMailCmd = new DelegateCommand(
                () => ReportDoc.ToMAPI(Name, Name),
                () => Worker.IsFree && ReportDoc != null);
        }

        #region IFrameForMultiWorkplace Members

        public virtual string Name { get; set; }
        public virtual bool CanClose { get; set; }

        #endregion
    }
}
